package it.unisannio.lesim.fsm;

import java.util.Vector;

/**
 *
 * @author Marco Calisti
 * @author Antonio Cuomo
 * @author Rocco Mazzeo
 * @author Francesco Pacilio
 * 
 */

public class Condition {
      
    private int timeLess;
    private int timeGreat;
    private String type;
    private String fieldExpression;
    
    public String getFieldExpression() {
        return fieldExpression;
    }

    public void setFieldExpression(String fieldExpression) {
        this.fieldExpression = fieldExpression;
    }

    public int getTimeGreat() {
        return timeGreat;
    }

    public void setTimeGreat(int timeGreat) {
        this.timeGreat = timeGreat;
    }

    public int getTimeLess() {
        return timeLess;
    }

    public void setTimeLess(int timeLess) {
        this.timeLess = timeLess;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Condition() {
        this.fieldExpression=null;
        this.type=null;
        this.timeGreat=-1;
        this.timeLess=-1;
    }
    
    public Vector getConditions(){
        Vector conditions = new Vector();
        
        if(timeLess!=-1)
            conditions.add("timeLess");
        if(timeGreat!=-1)
            conditions.add("timeGreat");
        if(type!=null)
            conditions.add("type");
        if(fieldExpression!=null)
            conditions.add("fieldExpression");
        
        return conditions;
    }   

}
